//
//  HomePageCell.swift
//  仿苹果首页动画
//
//  Created by slience on 2019/8/19.
//  Copyright © 2019 shehuiren. All rights reserved.
//

import UIKit

class HomePageCell: UITableViewCell {

    @IBOutlet weak var titleL : UILabel!
    @IBOutlet weak var contentL : UILabel!
    @IBOutlet weak var header : UIImageView!
    @IBOutlet weak var backView : UIView!
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}

extension UITableViewCell{
    
    func startAnimation(){
        self.isUserInteractionEnabled = false
        UIView.animate(withDuration: 0.2, animations: {
            self.transform = CGAffineTransform.init(scaleX: 0.9, y: 0.9)
        }) { (finish) in
            self.isUserInteractionEnabled = true
            
        }
    }
    
    func  stopAnimation(){
        
        self.isUserInteractionEnabled = false
        UIView.animate(withDuration: 0.2, animations: {
            self.transform = CGAffineTransform.identity
        }) { (finish) in
            self.isUserInteractionEnabled = true
            
        }
    }
}

